home *** CD-ROM | disk | FTP | other *** search
- Path: newsfeed.internetmci.com!xmission!news
- From: tknarr@xmission.com ( Todd Knarr )
- Newsgroups: comp.lang.c++
- Subject: Re: [] overload..(newbie in distress)
- Date: 21 Jan 1996 17:49:10 GMT
- Organization: Chaos Central
- Message-ID: <4dtuam$hf4@news.xmission.com>
- References: <DLGppJ.31C@undergrad.math.uwaterloo.ca> <Robert.Lendvai-2101960118330001@129.170.80.94>
- Reply-To: tknarr@xmission.com ( Todd Knarr )
- NNTP-Posting-Host: slc65.xmission.com
- X-Newsreader: IBM NewsReader/2 v1.2
-
- >In article <DLGppJ.31C@undergrad.math.uwaterloo.ca>,
- >tthiraku@landen.math.uwaterloo.ca (Thanou Thirakul) wrote:
- >> A[5] = val; // store val into the fifth node of a linklist.
- >> val = A[5] ; // returns the value of the fifth node of a linklist.
-
- It involves the return value of the operator[]() function. If it
- returns a reference, you can use it on the left side of the assignment.
- If it returns a non-reference, you can't.
-
- In <Robert.Lendvai-2101960118330001@129.170.80.94>, Robert.Lendvai@dartmouth.edu (Robert Lendvai) writes:
- >The = assignment operator can not be overloaded.
-
- It can easily be overloaded, the function is operator=(). It is
- not inherited by derived classes, that's all.
-
- --
- Todd Knarr : tknarr@xmission.com | finger for PGP public key
- | Member, USENET Cabal
-
- Seriously, I don't want to die just yet. I don't care how
- good-looking they are, I! don't! want! to! die!"
- -- Megazone ( UF1 )
-
-